home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
prog
/
cv_read.arj
/
TEST.PRG
< prev
Wrap
Text File
|
1994-03-13
|
2KB
|
71 lines
FUNCTION TEST()
* Test the UDFs in CV_READ by running a BASIC program and reading the results.
LOCAL nOutKey := 0, nHandle, cText, x1, x2, x3, n2, n3, nDecimals := 8
LOCAL Getlist := {}
CLEAR SCREEN
@ 01,01 SAY "Set DECIMALS to:" GET nDecimals PICTURE "99"
READ
SET DECIMALS TO nDecimals
SET FIXED ON
DO WHILE nOutKey <> 27
IF FILE("TEST.BAS")
* Use BASICA or GW-BASIC if your computer has it...
* RUN BASICA TEST
* RUN GW-BASIC TEST
* Use QBASIC to test but have it use Microsoft Binary Format
* in order to be compatible with older versions of BASIC
RUN QBASIC /MBF /RUN TEST
ENDIF
STORE SPACE(22) TO cText
IF FILE("TEST.DAT")
nHandle := FOPEN( "TEST.DAT", 0 )
* read "whole" line with all three examples
FREAD( nHandle, @cText, 22 )
FCLOSE( nHandle )
ENDIF
@ 08,00 SAY REPLICATE("=",80)
x1 := SUBSTR( cText, 2, 2 )
x2 := SUBSTR( cText, 7, 4 )
x3 := SUBSTR( cText, 14, 8 )
@ 10,10 SAY "Value returned by CVI("+x1+"): "
@ 10,50 SAY CVI(x1)
@ 11,10 SAY "Converted by MKI() => "+MKI(CVI(x1))
@ 13,10 SAY "Value returned by CVS("+x2+"): "
n2 := CVS(x2)
@ 13,50 SAY n2
@ 15,10 SAY SHOW_BIN(x2) // put after data
x2 := MKS(n2)
@ 14,10 SAY "Converted by MKS() => "+x2
@ 14,50 SAY CVS(x2)
@ 16,10 SAY SHOW_BIN(x2) // put after data
@ 18,10 SAY "Value returned by CVD("+x3+"): "
n3 := CVD(x3)
@ 18,50 SAY n3
@ 20,10 SAY SHOW_BIN(x3) // put after data
x3 := MKD(n3)
@ 19,10 SAY "Converted by MKD() => "+x3
@ 19,50 SAY CVD(x3)
@ 21,10 SAY SHOW_BIN(x3)
@ 23,00 SAY "Press [Esc] to quit; any other key to repeat ..."
nOutKey := INKEY(0)
ENDDO
RETURN .T.
*: END OF TEST.PRG